<%-- 
  - Author: Neha Chauhan
  - Date: 17-Apr-2011
  - Copyright Notice: TRAKHEES
  - Description: form.jsp
 --%>

<%@page import="org.springframework.web.context.request.RequestScope"%>
<%@page import="ae.pcfc.etks.online.web.util.SecurityUtils"%>
<%@ include file="/WEB-INF/view/include.jsp"%>
<%@ page import="ae.pcfc.etks.online.web.*"%>
<script type="text/javascript">
	$().ready(function() {

		//$("input:submit, input:reset, input:button, input:file").button();
		
	  });

</script>
	


<div id="container" dir='<spring:message code="page.dir"/>'  align='<spring:message code="page.align"/>'>


<form:form name="UserService" id="UserService"  method="POST" 
		modelAttribute="<%=ConstantsAdmin.USER_SERVICES_REQUEST_MODEL_KEY %>">
		<spring:hasBindErrors
			name="<%=ConstantsAdmin.USER_SERVICES_REQUEST_MODEL_KEY %>">
			<script type="text/javascript">
				$(document)
						.ready(
								function() {
									jAlert(
											'error',
											'<li><form:errors path="*" delimiter="<li>"/>',
											'<spring:message code="label.errormessage" />');
								});
			</script>
		</spring:hasBindErrors>
		
		<%
					if(request.getAttribute(ConstantsAdmin.SUCCESS_PARAM) != null) {
				%>
		<script type="text/javascript">
				$(document)
						.ready(
								function() {
									jAlert(
											'success','<%=request.getAttribute(ConstantsAdmin.SUCCESS_PARAM)%>',
											'');
								});
			</script>			
		<% }  %>
		<% 
		//if(request.getParameter("refNo") != null ){
		   if(session.getAttribute(ConstantsAdmin.SUCCESS_PARAM) != null && request.getParameter("refNo") != null){
			request.setAttribute("refNo", SecurityUtils.decryptQueryParam(request.getParameter("refNo")));
		%>
			
				<script type="text/javascript">
				$(document)
						.ready(
								function() {
									jAlert(
											'success','<spring:message code="success.service.register.request" arguments="${requestScope.refNo}"/>',
											'<spring:message code="label.menu.register.service" />');
								});
			</script>			
	
			
		<%
			session.removeAttribute(ConstantsAdmin.SUCCESS_PARAM);
		} %>
	
	<div class="ui-widget_c ui-corner-all" dir='<spring:message code="page.dir"/>'
	align='<spring:message code="page.align"/>' >
	<div class="ui-jqgrid-titlebar ui-widget-header ui-corner-top ui-helper-clearfix"><spring:message code="label.user.services" /></div>
	<c:choose>
		<c:when test="${null != serviceRegisterRefrenceData}">
		<div class="t_fin-black-txt">
		    <div class="fm-req">		
			      <p><spring:message code="label.user.servicesmessage" /></p>
	    	</div>
			<div>
				<table border="0" style="width:100%" class="t_grid-table">
					 <tr class="ui-jqgrid-labels">
					     <td>
					         <div class="ui-state-default ui-th-column ui-th-ltr"><spring:message code="label.user.serialno" /></div>
					      </td>
					 	<td>
					       	<div class="ui-state-default ui-th-column ui-th-ltr"><spring:message code="label.servicename.eng" /></div>
					 	</td>
					 	<td>
					      	<div class="ui-state-default ui-th-column ui-th-ltr"><spring:message code="label.servicename.arb" /></div>
						</td>
						<td>
					      	<div class="ui-state-default ui-th-column ui-th-ltr"><spring:message code="label.select" /></div>
						</td>
					</tr>
				    <c:forEach items="${serviceRegisterRefrenceData}" var="myitem" varStatus="status">
				      <tr>
				      	<td> <c:out value="${status.index +1 }"></c:out> </td>
				      	<td><c:out value="${myitem.strServiceNameEng}"/> </td>   
				        <td><c:out value="${myitem.strServiceNameArb}"/> </td>
				        <td><form:checkbox path="services" value="${myitem.strServiceID}"/></td>
				      </tr> 
				    </c:forEach>
			  </table>
			</div>		
		</div>
			<div id="fm-submit" class="fm-req">
					<input type="submit" name="next" value="<spring:message code="label.button.continue" />" class="t_btns submit"/>			
					<input type="reset" name="reset" value="<spring:message code="label.button.reset" />" class="t_btns reset"/>
			</div>
		</c:when>
		<c:otherwise>
			<spring:message code="msg.no.service.available" />
		</c:otherwise>		
	</c:choose>			
	</div>
	
	
	</form:form>
</div>
